﻿<Window x:Class="Test6_mod.StartPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"  
        xmlns:local="clr-namespace:Test6_mod"
        Title="Мой Парсер" 
        WindowStartupLocation="CenterScreen"
        WindowState="Maximized"
        Height="560" 
        Width="950">
    <Window.Resources>
        <Style x:Key="ScrollThumbs" TargetType="{x:Type Thumb}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid x:Name="Grid">
                            <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" 
                                           Height="Auto" Fill="Transparent"/>
                            <Border x:Name="Rectangle1" CornerRadius="5 5 5 5" HorizontalAlignment="Stretch" 
                                        VerticalAlignment="Stretch" Width="Auto" Height="Auto" 
                                        Background="{TemplateBinding Background}"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="Tag" Value="Horizontal">
                                <Setter TargetName="Rectangle1" Property="Width" Value="Auto"/>
                                <Setter TargetName="Rectangle1" Property="Height" Value="5"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
            <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
            <Setter Property="Foreground" Value="{StaticResource Cursor_1}"/>
            <Setter Property="Width" Value="5"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ScrollBar}">
                        <Grid x:Name="GridRoot" Width="5" Background="{x:Null}">
                            <Track x:Name="PART_Track" Grid.Row="0" IsDirectionReversed="true" Focusable="False">
                                <Track.Thumb>
                                    <Thumb x:Name="Thumb" Background="{TemplateBinding Foreground}" 
                                               Style="{DynamicResource ScrollThumbs}"/>
                                </Track.Thumb>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton x:Name="PageUp" Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="False"/>
                                </Track.IncreaseRepeatButton>
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton x:Name="PageDown" Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="False"/>
                                </Track.DecreaseRepeatButton>
                            </Track>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger SourceName="Thumb" Property="IsMouseOver" Value="true">
                                <Setter Value="{DynamicResource ButtonSelectBrush}" 
                                            TargetName="Thumb" Property="Background"/>
                            </Trigger>
                            <Trigger SourceName="Thumb" Property="IsDragging" Value="true">
                                <Setter Value="{DynamicResource DarkBrush}" TargetName="Thumb" Property="Background"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="Thumb" Property="Visibility" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="Orientation" Value="Horizontal">
                                <Setter TargetName="GridRoot" Property="LayoutTransform">
                                    <Setter.Value>
                                        <RotateTransform Angle="-90"/>
                                    </Setter.Value>
                                </Setter>
                                <Setter TargetName="PART_Track" Property="LayoutTransform">
                                    <Setter.Value>
                                        <RotateTransform Angle="-90"/>
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="Width" Value="Auto"/>
                                <Setter Property="Height" Value="10"/>
                                <Setter TargetName="Thumb" Property="Tag" Value="Horizontal"/>
                                <Setter TargetName="PageDown" Property="Command" Value="ScrollBar.PageLeftCommand"/>
                                <Setter TargetName="PageUp" Property="Command" Value="ScrollBar.PageRightCommand"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid Background="{StaticResource DarkGreay_9}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="15*"/>
                <ColumnDefinition Width="10*"/>
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <!-- Рабочая область-->
                <Grid Grid.Row="0" Margin="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0" Margin="1 0 1 0" 
                          Background="{StaticResource DarkGreay_10}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="35"/>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="100"/>
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0" 
                              Background="{StaticResource TealBrush_10}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="35"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid Grid.Column="0">
                                <materialDesign:PackIcon Kind="Worker" 
                                                 Width="30" 
                                                 Height="30" 
                                                 VerticalAlignment="Center" 
                                                 Foreground="{StaticResource MyWhite_0}"/>
                            </Grid>
                            <Grid Grid.Column="1">
                                <TextBlock Style="{StaticResource txtOption18}">Рабочая область</TextBlock>
                            </Grid>
                        </Grid>
                        <Grid Grid.Row="1">
                            <TextBox x:Name="txtURL" 
                                     materialDesign:HintAssist.Hint="Ввдите URL адресс: http://..." 
                                     Margin="2 0" 
                                     Foreground="{StaticResource MyWhite_0}" 
                                     FontSize="15" 
                                     FontFamily="Segoe UI"
                                     TextWrapping="Wrap"
                                     AcceptsReturn="True"
                                     VerticalScrollBarVisibility="Auto"
                                     Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
                        </Grid>
                        <Grid Grid.Row="2">
                            <ListView x:Name="ListViewRegist" 
                                Foreground="LightGray" 
                                FontFamily="Champagne &amp; Limousines" 
                                FontSize="18" 
                                SelectedIndex="0" 
                                Width="auto"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
                                ScrollViewer.VerticalScrollBarVisibility="Disabled">
                                <ListViewItem Name="btnAdd" Height="50" MouseDoubleClick="AddUrlPage">
                                    <StackPanel Orientation="Horizontal" 
                                            Focusable="False">
                                        <materialDesign:PackIcon Kind="Add" 
                                                             Width="35" 
                                                             Height="35" 
                                                             VerticalAlignment="Center" 
                                                             Foreground="{StaticResource MyWhite_0}"
                                                             Margin="13,0"/>
                                        <TextBlock Name="AddText" 
                                               Text="Добавить сайт" 
                                               FontSize="15" 
                                               VerticalAlignment="Center" 
                                               Foreground="{StaticResource MyWhite_0}" 
                                               Margin="10,0" 
                                               Focusable="False"/>
                                    </StackPanel>
                                </ListViewItem>
                                <ListViewItem Name="btnScan" Height="50" MouseDoubleClick="StartScanning">
                                    <StackPanel Orientation="Horizontal"
                                            Focusable="False">
                                        <materialDesign:PackIcon Kind="Download" 
                                                             Width="35" Height="35"
                                                             VerticalAlignment="Center" 
                                                             Foreground="{StaticResource MyWhite_0}" 
                                                             Margin="13,0"/>
                                        <TextBlock Name="ScanText" 
                                               Text="Сканировать сайт" 
                                               FontSize="15"
                                               VerticalAlignment="Center" 
                                               Foreground="{StaticResource MyWhite_0}" 
                                               Margin="10,0" 
                                               Focusable="False"/>
                                    </StackPanel>
                                </ListViewItem>
                            </ListView>
                        </Grid>
                    </Grid>
                    <Grid Grid.Column="1" 
                          Margin="1 0 0 0"
                          Background="{StaticResource DarkGreay_10}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="35"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0"  
                              Background="{StaticResource TealBrush_10}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="35"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid Grid.Column="0">
                                <materialDesign:PackIcon Kind="ViewList" 
                                                 Width="30" 
                                                 Height="30" 
                                                 VerticalAlignment="Center" 
                                                 Foreground="{StaticResource MyWhite_0}"/>
                            </Grid>
                            <Grid Grid.Column="1">
                                <TextBlock Style="{StaticResource txtOption18}">Список сайтов</TextBlock>
                            </Grid>
                        </Grid>
                        <Grid Grid.Row="1">
                            <DataGrid x:Name="CollectionURL" 
                                      AutoGenerateColumns="False"                              
                                      FontSize="10"
                                      Foreground="{DynamicResource DarkGreay_3}"
                                      Background="Transparent"
                                      CanUserAddRows="False"
                                      CanUserDeleteRows="False"
                                      BorderBrush="{x:Null}" 
                                      GridLinesVisibility="Vertical"
                                      materialDesign:ThemeAssist.Theme="Dark"                                   
                                      VerticalGridLinesBrush="#B2686868" SelectionChanged="CollectionURL_SelectionChanged">
                                <DataGrid.Columns>
                                    <DataGridTextColumn Width="*" 
                                                IsReadOnly="True" 
                                                Binding="{Binding IsName}" 
                                                Header="Имя"/>
                                    <DataGridTextColumn Width="*" 
                                                IsReadOnly="True" 
                                                Binding="{Binding IsURL}" 
                                                Header="Сылка"/>
                                    <DataGridTextColumn Width="70" 
                                                IsReadOnly="True" 
                                                Binding="{Binding IsStatus, 
                                                                  Mode=TwoWay, 
                                                                  UpdateSourceTrigger=PropertyChanged}" 
                                                Header="Статус"/>
                                </DataGrid.Columns>
                            </DataGrid>
                        </Grid>
                    </Grid>
                </Grid>
                <!-- Область логов-->
                <Grid Grid.Row="1" Margin="0 1 0 0" 
                      Background="{StaticResource Dash_Background}">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="35"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0"  
                          Background="{StaticResource DarkGreay_11}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="35"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid Grid.Column="0">
                            <materialDesign:PackIcon Kind="MonitorEdit" 
                                                 Width="30" 
                                                 Height="30" 
                                                 VerticalAlignment="Center" 
                                                 Foreground="{StaticResource MyWhite_0}"/>
                        </Grid>
                        <Grid Grid.Column="1">
                            <TextBlock Style="{StaticResource txtOption18}">Логирования ошибок</TextBlock>
                        </Grid>
                    </Grid>
                    <Grid Grid.Row="1">
                        <DataGrid x:Name="LogTable" 
                                  AutoGenerateColumns="False"                              
                                  FontSize="10"
                                  Foreground="{DynamicResource DarkGreay_3}"
                                  Background="Transparent"
                                  CanUserAddRows="False"
                                  CanUserDeleteRows="False"
                                  BorderBrush="{x:Null}" 
                                  GridLinesVisibility="Vertical"
                                  materialDesign:ThemeAssist.Theme="Dark" 
                                  VerticalGridLinesBrush="#B2686868">
                            <DataGrid.Columns>
                                <DataGridTextColumn Width="67" 
                                                IsReadOnly="True"  
                                                Binding="{Binding IsId}" 
                                                Header="Ключь"/>
                                <DataGridTextColumn Width="30*" 
                                                IsReadOnly="True" 
                                                Binding="{Binding IsComent}" 
                                                Header="Описание"/>
                                <DataGridTextColumn Width="10*" 
                                                IsReadOnly="True" 
                                                Binding="{Binding IsStatus}" 
                                                Header="Статус"/>
                            </DataGrid.Columns>
                        </DataGrid>
                    </Grid>
                </Grid>
            </Grid>
            <!-- Область HTML-->
            <Grid Grid.Column="1" Margin="1" Background="{StaticResource DarkGreay_10}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="35"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid Grid.Row="0"  
                      Background="{StaticResource TealBrush_10}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="35"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <materialDesign:PackIcon Kind="Code" 
                                                 Width="30" 
                                                 Height="30" 
                                                 VerticalAlignment="Center" 
                                                 Foreground="{StaticResource MyWhite_0}"/>
                    </Grid>
                    <Grid Grid.Column="1">
                        <TextBlock Style="{StaticResource txtOption18}">Html - контент</TextBlock>
                    </Grid>
                </Grid>
                <Grid Grid.Row="1">
                    <TextBox Name="HtmlContent"
                             Margin="2 0" 
                             Foreground="{StaticResource MyWhite_0}" 
                             FontSize="15" 
                             FontFamily="Segoe UI"
                             TextWrapping="Wrap"
                             AcceptsReturn="True"
                             VerticalScrollBarVisibility="Auto"
                             Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</Window>